package com.goose.bmm.controler.adapter;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.goose.bmm.R;
import com.goose.bmm.model.entity.NavDrawerItem;

public class NavDrawerListAdapter extends BaseAdapter {

	private Context context;
	private String[] listCommandEvents;

	public NavDrawerListAdapter(Context context, String[] commands) {
		this.context = context;
		this.listCommandEvents = commands;
	}

	@Override
	public int getCount() {
		return listCommandEvents.length;
	}

	@Override
	public Object getItem(int position) {
		return listCommandEvents[position];
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup arg2) {
		if (convertView == null) {
			LayoutInflater mInflater = (LayoutInflater) context
					.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
			convertView = mInflater.inflate(R.layout.item_list_nav, null);
		}

		ImageView mImageView = (ImageView) convertView
				.findViewById(R.id.img_icon_nav_item);
		TextView mTextView = (TextView) convertView
				.findViewById(R.id.tv_nav_item);

		mTextView.setText(listCommandEvents[position]);

		return convertView;
	}

}
